import java.io.IOException;
import java.net.DatagramPacket;
import java.net.SocketException;
import java.util.HashMap;

public class UdpDicServer_0603 extends UdpEchoServer_0602{
    private HashMap<String,String> map = new HashMap<>();
    public UdpDicServer_0603(int port) throws SocketException {
        super(port);
        map.put("cat","🐱");
        map.put("dog","🐕");
        map.put("chicken","🐔");
    }

    @Override
    public String process(String request) {
        return map.getOrDefault(request,"找不到！");
    }

    public static void main(String[] args) throws IOException {
        UdpDicServer_0603 udpDicServer0603 = new UdpDicServer_0603(9090);
        udpDicServer0603.start();
    }
}
